#include <iostream>
#include <vector>
using namespace std;

int findJudge(int N, vector<vector<int>>& trust) {
  vector<int> trustCount(N + 1, 0); 

  for (auto t : trust) {
    trustCount[t[0]]--; 
    trustCount[t[1]]++; 
  }

  for (int i = 1; i <= N; i++) {
    if (trustCount[i] == N - 1) { 
      return i;
    }
  }

  return -1; 
}

int main() {
  int N = 4;
  
  vector<vector<int>> trust = {{1, 3}, {1, 4}, {2, 3}, {2, 4}, {4, 3}};
  
  int judge = findJudge(N, trust);

  if (judge != -1) {
    cout << "小镇的法官是：" << judge << endl;
  } else {
    cout << "没有找到小镇的法官" << endl;
  }

  return 0;
}